package compare.comparable;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-02-22
 * Time: 02:38
 */
public class Student implements Comparable<Student> {
    public int id;
    public String name;

    public Student(int id, String name) {
        this.id = id;
        this.name = name;
    }

    @Override
    public int compareTo(Student o) {
        //return Integer.compare(this.id,o.id);
        return this.id - o.id;
    }

    @Override
    public String toString() {
        return "StudentA{" +
                "id=" + id +
                ", name='" + name + '\'' +
                '}';
    }
}
